 var myScroll, pullDownEl, pullDownOffset, pullUpEl, pullUpOffset, generatedCount = 0;
                var cid = 0;
        zy_init();
        window.uexOnload = function(type){
            if (!type) {
                uexWindow.setBounce("1");
                uexWindow.showBounceView("0", "#FFF", "0");
                uexWindow.showBounceView("1", "#FFF", "0");
                //我这里是初始加截内容
                //.....
                //.....
                document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
                loaded();
                                
            }
        }
                
        function pullDownAction(){
            setTimeout(function(){
               //拉到刷新的内容
                myScroll.refresh(); 
            }, 1000);
        }
        
        function pullUpAction(){
            setTimeout(function(){
                //拉到刷新的内容
                myScroll.refresh();
            }, 1000);
        }
        
        function loaded(){
            pullDownEl = document.getElementById('pullDown');
            pullDownOffset = pullDownEl.offsetHeight;
            pullUpEl = document.getElementById('pullUp');
            pullUpOffset = pullUpEl.offsetHeight;
            myScroll = new iScroll('wrapper', {
                useTransition: true,
                topOffset: pullDownOffset,
                onRefresh: function(){
                    if (pullDownEl.className.match('loading')) {
                        pullDownEl.className = '';
                        pullDownEl.querySelector('.pullDownLabel').innerHTML = 'Pull down to refresh...';
                    }
                    else 
                        if (pullUpEl.className.match('loading')) {
                            pullUpEl.className = '';
                            //pullUpEl.querySelector('.pullUpLabel').innerHTML = 'Pull up to load more...';
                        }
                },
                onScrollMove: function(){
                    if (this.y > 5 && !pullDownEl.className.match('flip')) {
                        pullDownEl.className = 'flip';
                        pullDownEl.querySelector('.pullDownLabel').innerHTML = 'Release to refresh...';
                        this.minScrollY = 0;
                    }
                    else 
                        if (this.y < 5 && pullDownEl.className.match('flip')) {
                            pullDownEl.className = '';
                            pullDownEl.querySelector('.pullDownLabel').innerHTML = 'Pull down to refresh...';
                            this.minScrollY = -pullDownOffset;
                        }
                        else 
                            if (this.y < (this.maxScrollY - 5) && !pullUpEl.className.match('flip')) {
                                pullUpEl.className = 'flip';
                                //pullUpEl.querySelector('.pullUpLabel').innerHTML = 'Release to refresh...';
                                this.maxScrollY = this.maxScrollY;
                            }
                            else 
                                if (this.y > (this.maxScrollY + 5) && pullUpEl.className.match('flip')) {
                                    pullUpEl.className = '';
                                   // pullUpEl.querySelector('.pullUpLabel').innerHTML = 'Pull up to load more...';
                                    this.maxScrollY = pullUpOffset;
                                }
                },
                onScrollEnd: function(){
                    if (pullDownEl.className.match('flip')) {
                        pullDownEl.className = 'loading';
                        pullDownEl.querySelector('.pullDownLabel').innerHTML = 'Loading...';
                        pullDownAction(); // Execute custom function (ajax call?)
                    }
                    else 
                        if (pullUpEl.className.match('flip')) {
                            pullUpEl.className = 'loading';
                            //pullUpEl.querySelector('.pullUpLabel').innerHTML = 'Loading...';
                            pullUpAction(); // Execute custom function (ajax call?)
                        }
                }
            });
            
            setTimeout(function(){
                document.getElementById('wrapper').style.left = '0';
            }, 800);
        }